import 'babel-polyfill'
import * as express from 'express';
import ssrMiddleware from './ssrMiddleware';
import * as bodyParser  from 'body-parser';

import { settings } from '../src/utils';

// 服务器端渲染
settings.isServer = true;
const app = express();
app.use(bodyParser.json());
app.use('/static', express.static('dist'));
app.use(ssrMiddleware);
app.disable('x-powered-by');

const server = app.listen(8990, () => {
  const { port } = server.address();
  console.info(`Listened at http://localhost:${port}`);
});
